//
//  RootViewController.m
//  无限循环滚动
//
//  Created by dllo on 15/11/27.
//  Copyright © 2015年 ER. All rights reserved.
//

#import "RootViewController.h"
#import "RootView.h"
#define WIDTH [UIScreen mainScreen].bounds.size.width
#define HEIGHT [UIScreen mainScreen].bounds.size.height
@interface RootViewController ()

@end

@implementation RootViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    NSArray *array1 = [NSArray arrayWithObjects:@"0.png",@"1.png",@"1.png", nil];
    NSArray *array2 = [NSArray arrayWithObjects:@"13.png",@"9.png",@"12.png",@"7.png", nil];
    NSArray *array3 = [NSArray arrayWithObjects:@"7.png",@"8ac54f4652d416eb62ab60c2f797e65d249fb77127d43-VicJeb_fw658.jpeg",@"9.png",@"7.png",@"10.png", nil];
    NSArray *array4 = [NSArray arrayWithObjects:@"1.png",@"t01e6837cb73ad851d8.jpg",@"6.png",@"11.png",@"9.png",@"15421308762727294389.jpg", nil];
    NSArray *array5 = [NSArray arrayWithObjects:@"e8068be19f.jpg",@"dba2ac27a034bfb07897eeea2584017d27a538cd32195-RUbJOY_fw658.jpeg",@"686c179c6f53cf8756e47012b2c3201e05ed67368f97-A90Rn9_fw658.jpeg",@"686c179c6f53cf8756e47012b2c3201e05ed67368f97-A90Rn9_fw658.jpeg",@"t01e6837cb73ad851d8.jpg",@"ee6fd8dab92af0705aecba072e4c9ca39f9e5f991d916-0sbFiB_fw658.jpeg",@"686c179c6f53cf8756e47012b2c3201e05ed67368f97-A90Rn9_fw658.jpeg",@"15421308762727294389.jpg",@"15421308762727294389.jpg",@"686c179c6f53cf8756e47012b2c3201e05ed67368f97-A90Rn9_fw658.jpeg", nil];
    NSArray *arrayM = [NSMutableArray arrayWithObjects:array1,array2,array3,array4,array5, nil];
    for (int i = 0; i<5; i++) {
        RootView *  rootView = [[RootView alloc] initWithFrame:CGRectMake(0, HEIGHT/5/2, WIDTH/5, HEIGHT/5) withNSArray:arrayM[i]];
        [rootView.page removeFromSuperview];
        rootView.center = CGPointMake(WIDTH/10+WIDTH/5*i, HEIGHT/20);
        [self.view addSubview:rootView];
    }
//    RootView *rootView = [[RootView alloc] initWithFrame:[UIScreen mainScreen].bounds];
    NSArray *array = [NSArray arrayWithObjects:@"7.png",@"8.png",@"9.png",@"10.png",@"p00010525.jpg",@"t01e6837cb73ad851d8.jpg",@"13.png",@"6.png",@"5.png",@"R4.png",@"R3.png",@"2.png",@"1.png",@"0.png",@"15421308762727294389.jpg",@"686c179c6f53cf8756e47012b2c3201e05ed67368f97-A90Rn9_fw658.jpeg",@"ee6fd8dab92af0705aecba072e4c9ca39f9e5f991d916-0sbFiB_fw658.jpeg",@"t01e6837cb73ad851d8.jpg", nil];
    RootView *rootView = [[RootView alloc] initWithFrame:CGRectMake(0, HEIGHT/8, WIDTH, HEIGHT/12*9) withNSArray:array];
    [self.view addSubview:rootView];
    // Do any additional setup after loading the view.
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
